import request from '@/utils/request'

// 查询档案列表
export function listRecords(query) {
  return request({
    url: '/training/records/list',
    method: 'get',
    params: query
  })
}

// 查询档案详细
export function getRecords(recordId) {
  return request({
    url: '/training/records/' + recordId,
    method: 'get'
  })
}

// 新增档案
export function addRecords(data) {
  return request({
    url: '/training/records',
    method: 'post',
    data: data
  })
}

// 修改档案
export function updateRecords(data) {
  return request({
    url: '/training/records',
    method: 'put',
    data: data
  })
}

// 删除档案
export function delRecords(recordId) {
  return request({
    url: '/training/records/' + recordId,
    method: 'delete'
  })
}

    /**
     * 通过报名id获取档案详细信息进行补充上传
     * lqx
     */
export function selectRecordsByRegistrationIds(registrationIds) {
  return request({
    url: '/training/records/upload-supplement/' + registrationIds,
    method: 'get'
  })
}

/**
     * 处理档案提交（新增、修改、删除）
     * @param frontSubmitDto 前端提交的数据
     * @return 处理结果
     * lqx
     */
export function handleRecordsSubmit(FrontSubmitDto) {
  return request({
    url: '/training/records/addRecordsList',
    method: 'post',
    data:FrontSubmitDto
  })
}
